cmake_minimum_required (VERSION 3.8)

#project(sqlite3xx)

include (../options.cmake)

include_directories("../wolfssl/wolfssl")
include_directories("../wolfssl")

link_directories("../wolfssl")


#wolfssl
add_definitions(-DWOLFSSL_LIB)


IF(WIN32)

	# sqlite
	add_definitions(-DSQLITE_HAS_CODEC)
	add_definitions(-DSQLITE_TEMP_STORE=3)
	add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA)
	add_definitions(-DSQLITE_ENABLE_UNLOCK_NOTIFY)
	add_definitions(-DSQLITE_CORE=1)
	add_definitions(-DSQLITE_AMALGAMATION=1)

	add_definitions(-DWOLFSSL_USER_SETTINGS)
	add_definitions(-DCYASSL_USER_SETTINGS)
	add_definitions(-DWOLFSSL_IGNORE_FILE_WARN)
	add_definitions(-DSSL_SNIFFER_EXPORTS)
	#add_definitions(-DHAVE_FIPS)
	#add_definitions(-D_MSC_VER)
	#add_definitions(-DWOLFSSL_SGX)

	#add_definitions(-DOPENSSL_EXTRA)
ELSEIF(UNIX)
ENDIF()


#file(GLOB sqlite3xx_srcs "*.c" "*.cpp")
#file(GLOB sqlite3xx_srcs "sqlite3.c" "sqlite3xx.cpp" "crypto.c")
file(GLOB sqlite3xx_srcs "sqlite3.c" "sqlite3xx.cpp" "crypto_openssl.c")
file(GLOB wolfssl_srcs "../wolfssl/wolfcrypt/src/*.c*" "../wolfssl/src/*.c")
#add_library(sqlite3xx STATIC ${sqlite3xx_srcs} $<TARGET_OBJECTS:wolfssl>)
add_library(sqlite3xx_objs OBJECT ${sqlite3xx_srcs} ${wolfssl_srcs})
add_library(sqlite3xx STATIC $<TARGET_OBJECTS:sqlite3xx_objs>)
